        //##########################################################################//
	// Scrolling background Tutorial Code by http://www.kudoswebsolutions.com
        // Original Source code: http://youlove.us/
        // Modified and extended by Kudos Web Solutions
        // copyright 2009 kudoswebsolutions.com
        //##########################################################################//

$(function() {
	// Define the height of your two background images.
           //The image to scroll
	   var backgroundleft = 1000;
           //The image to overlay
	   var backgroundheight_two = 1000;

	// Create a random offset for both images' starting positions
        offset = Math.round(Math.floor(Math.random()* 2001));
       
 
	function scrollbackground() {
                //Ensure all bases are covered when defining the offset.
   		offset = (offset < 1) ? offset + (backgroundleft - 5) : offset - 1;
		// Put the background onto the required div and animate vertically
   		$('#center-img1').css("background-position", "50% " + offset + "px");
   		$('#center-img2').css("background-position", "50% " + offset + "px");
   		$('#center-img3').css("background-position", "50% " + offset + "px");
   		$('#center-img4').css("background-position", "50% " + offset + "px");
   		$('#center-img5').css("background-position", "50% " + offset + "px");
   		
   		// Enable the function to loop when it reaches the end of the image
   		setTimeout(function() {
			scrollbackground();
			}, 50
		);
   	}
	

	// Initiate the scroll
	scrollbackground();
	

	/*// Use the offset defined earlier and apply it to the div.
   		$('#overlay').css("background-position", "50% " + offset2 + "px");
   	
   	//스포츠 축구 배경이미지 호버시 배경모션
   		$('.main_football').hover(function(){
   			//배경이미지 이동

   			$('.main_football .mask_sports').addClass("hide");
   			$('.main_football .section_off').addClass("hide"); 

   			$('.football_title .main_f_img').addClass("on");
   			$(".football_title .sports_bar").stop().animate({width:'278px',opacity:'1'},"3000");
   			$(this).find(".sub_menu1").slideDown('slow');
   			$(this).find(".sub_menu2").slideDown('slow');
   			
   			$('.sm_bg', this).show();
   			$('.sm_bg img', this).animate({'left' : '-150px'},20000, function() {
   				$(this).animate({'top' : '-600px'}, 16000, function() {
   					$(this).animate({'left' : '-1500px'}, 20000,function() {
   						$(this).animate({'top' : '-145px'}, 16000, function() {
   				
   						})		
   					});					
   				});						
   			});  
   		
   		},function(){
   			$('.football_title .main_f_img').removeClass("on");
   			$(this).find(".sports_bar").stop().animate({width:'0'},"0");
   			$(".football_title .sub_bar2").stop().animate({width:'0px',opacity:'1'},"0" );
   			$('.football_title .sub_menu2').stop().slideUp(0);
   			$(".football_title .sub_bar1").stop().animate({width:'0px',opacity:'1'},"0" );
   			$('.football_title .sub_menu1').stop().slideUp(0);

   			$('.main_football .section_off').removeClass("hide"); 
   			$('.mask_sports').removeClass("hide");
   			$('.sm_bg img', this).stop().animate({'left' : '-1500px' , 'top' : '-157px'}, 0);
   			$('.sm_bg', this).hide();
   		});
   		
   		//football 마우스 오버시 효과
   		$('.football_title').hover(function(){	
   			$('.football_title .main_f_img').addClass("on");
   			//$(".football_title .sports_bar").animate({width:'278px',opacity:'1'},"3000");
   			$(this).find(".sub_menu1").slideDown();
   			$(this).find(".sub_menu2").slideDown();

   		}, function() {

   			//$('.football_title .main_f_img').removeClass("on");
   			//$(this).find(".sports_bar").animate({width:'0'},"3000");
   			$(".football_title .sub_bar2").stop().animate({width:'0px',opacity:'1'},"0" );
   			//$('.football_title .sub_menu2').slideUp();
   			$(".football_title .sub_bar1").stop().animate({width:'0px',opacity:'1'},"0" );
   			//$('.football_title .sub_menu1').slideUp();
   		})

   		//서브 타이틀1 효과	
   		$('.football_title .sub_menu1 a').hover(function(){
   			$(".football_title .sub_bar1").stop().animate({width:'100px',opacity:'1'},"3000" );
   			
   		},function (){
   			$(".football_title .sub_bar1").stop().animate({width:'0px',opacity:'1'},"3000" );
   		});
   		
   		//서브 타이틀2효과	
   		$('.football_title .sub_menu2').hover(function(){
   			$(".football_title .sub_bar2").stop().animate({width:'210px',opacity:'1'},"3000" );
   		},function (){
   			$(".football_title .sub_bar2").stop().animate({width:'0px',opacity:'1'},"3000" );
   		});*/
   		
   		
});


